package cn.piaoyi.web.action;

import java.util.Map;

import cn.piaoyi.bean.Admin;
import cn.piaoyi.comm.Constant;
import cn.piaoyi.comm.Util;
import cn.piaoyi.service.AdminService;
import cn.piaoyi.web.servlet.AdminSession;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.interceptor.SessionAware;

public class AdminLogout extends BaseAction implements SessionAware {
	private static final Log logger = LogFactory.getLog(AdminLogout.class);

	private Map session;

	public void setSession(Map session) {
		this.session = session;
	}

	public Map getSession() {
		return session;
	}

	public String execute() {
		try {
			return this.executeMethod(this.getAction());
		} catch (Exception e) {
			logger.error(e);
			return INPUT;
		}
	}

	/**
	 * 初始页
	 */
	public String index(){
		this.getSession().remove(Constant.ADMIN_SESSION_KEY);
		return "admin_login";
	}
	
}
